package com.tangfuzhong.proxy;

import java.lang.reflect.Proxy;

public class TargetProxy {
    public static Object wrap(Object target, MyInterceptor myInterceptor) {
        HWInvocationHandler targetProxy = new HWInvocationHandler(target, myInterceptor);
        return Proxy.newProxyInstance(target.getClass().getClassLoader(), target.getClass().getInterfaces(),targetProxy);
    }
}
